import functools

class Solution(object):
    def largestNumber(self, nums):
        """
        :type nums: List[int]
        :rtype: str
        """
        def compare(a,b):
            if a+b>b+a:
                return -1
            else:
                return 1
        nums = [str(i) for i in nums]
        nums.sort(key=functools.cmp_to_key(compare))
        return ''.join(nums) if nums[0]!='0' else '0'